<template>
	<view>
		<view class="box" v-for="(goods,index) in goods" :key="index">
			<image :src="goods.url"></image>
			<view class="title_box">
				<view class="title">{{goods.goods_title}}</view>
				<!-- <view>{{goods.goods_num}}</view> -->
				<view class="text">{{goods.spec_name}}</view>
			</view>
		</view>
		<view class="box2">
			<view class="item" @click="navRefund(1)">
				<image src="../../static/tui.png" mode=""></image>
				<view class="tetx">
					<view>我要退款退货</view>
					<view>已收到货，需要退还收到的货物</view>
				</view>
			</view>
			<view class="item" @click="navRefund(2)">
				<image src="../../static/qian.png" mode=""></image>
				<view class="tetx">
					<view>我要退款(无需退货）</view>
					<view>没收到货，或与商家协商同意不用退货只退款</view>
				</view>
			</view>
			<!-- <view class="item"  @click="navRefund(3)">
				<image src="../../static/huan.png" mode=""></image>
				<view class="tetx">
					<view>我要换货</view>
					<view>已收到货，需要更换已收到的货物</view>
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				goods:[],
			};
		},
		onLoad(option) {
			this.id = option.id
			this.orderinfo(this.id)
		},
		methods: {
			// 退款跳转 1我要退款退货 2我要退款(无需退货）
			navRefund(type) {
				uni.navigateTo({
					url: "/personalData/refund/refund?type=" + type +'&id='+this.id//1退款退货 2退款不退货 3我要换货
				})
			},
			//获取订单详情
			orderinfo(orderid){
				this.$http({
					url:'api/Wechat/orderDetail',
					data:{
						orderid:orderid
					}
				}).then(res=>{
					this.goods = res.data.goods
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 188rpx;
		background: #FFFFFF;
		border-radius: 14rpx;
		padding: 10rpx 48rpx 14rpx 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		box-sizing: border-box;

		.radio {
			.btn_radio {
				transform: scale(0.9)
			}
		}

		image {
			width: 160rpx;
			height: 160rpx;
			flex-shrink: 0;
			margin: 0 26rpx 0 0;
			border-radius: 7rpx ;
		}

		.title_box {
			height: 100%;
			display: flex;
			flex-direction: column;
			width: 100%;
			gap: 26rpx 0;

			.title {
				font-size: 28rpx;
				font-family: Source Han Sans CN-Medium, Source Han Sans CN;
				font-weight: 500;
				color: #333333;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				line-height: 1em;
				margin-top: 16rpx;
			}

			.text {
				font-size: 26rpx;
				font-family: Source Han Sans CN-Regular, Source Han Sans CN;
				font-weight: 400;
				color: #555555;
				line-height: 1em;
			}
		}
	}

	.box2 {
		margin-top: 24rpx;
		width: 750rpx;
		// height: 470rpx;
		background: #FFFFFF;
		border-radius: 10rpx 10rpx 10rpx 10rpx;

		.item {
			width: 690rpx;
			height: calc(100% / 3);
			margin: 0 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 40rpx 0;
			box-sizing: border-box;
			border-bottom: 2rpx solid #F1F1F1;
			gap: 0 28rpx;

			image {
				width: 40rpx;
				height: 40rpx;
				flex-shrink: 0;
			}

			.tetx {
				width: 100%;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				:first-child {
					font-size: 28rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #222222;
					line-height: 2em;
				}

				:last-child {
					font-size: 26rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #999999;
					line-height: 2em;
				}
			}

		}

		:last-child {
			border: none;
		}
	}
</style>
